package com.csd.action.manager;

import com.csd.helper.ActionResult;
import com.csd.pojo.ProjectType;
import com.csd.service.IProjectTypeService;
import com.opensymphony.xwork2.ActionSupport;

/**
 * 添加项目类别
 * @author sanmu
 * <br> 创建于2009-12-17
 */
public class ProjectTypeAddAction extends ActionSupport {

	private ProjectType projectType;
	
	private IProjectTypeService projectTypeService;
	
	
	public ProjectType getProjectType() {
		return projectType;
	}

	public void setProjectType(ProjectType projectType) {
		this.projectType = projectType;
	}

	public IProjectTypeService getProjectTypeService() {
		return projectTypeService;
	}

	public void setProjectTypeService(IProjectTypeService projectTypeService) {
		this.projectTypeService = projectTypeService;
	}
	
	public String execute() throws Exception {
		String text = ActionResult.fail;
		boolean bl = false;
		//添加项目类型
		bl = projectTypeService.addProjectType(projectType);
		if (bl) {
			text = ActionResult.success;
		}
		return text;
	}
}
